All Questions
Tagged with numpycomputational-geometry
20 questions
1vote
1answer
508views
Create normals from triangulated surface
Objective I have a 3D face mesh triangulated. I have computed the midpoint of each triangle in the mesh, and I have the normal vector (n1, n2,n3) for each triangle. The objective is to create a 2D ...
2votes
2answers
104views
Sampling from k circles with different radii
Description: I would like to sample n_points points from k circles whose radii and centers are given as lists. Note: This is my ...
1vote
2answers
273views
Read coordinates from many files and calculate polygon areas
My goal with this snippet is to create an array of coordinates which in turn is a tuple of 68 elements, area and modified area array for all 10k elements and assign it to the ...
6votes
1answer
944views
Choosing evenly distributed points from a million points on a sphere
I have \$10^5\$ to \$10^6\$ points on a sphere, and want to choose some points from them which are as close as uniformly distributed as possible. For that reason, I do the following: at each step I ...
7votes
0answers
5kviews
Cubic spline interpolation in Python from scratch
I implemented the cubic spline interpolation explained in https://en.wikipedia.org/wiki/Spline_interpolation as a Python class. Of course, such an interpolation should exist already in some Python ...
6votes
1answer
591views
Searching extreme points of polyhedron
In my Uni, my scientific professor asked me to make some researches about the extreme points of polyhedrals. And I did them. I found that there is still no code in public for searching extreme points ...
6votes
1answer
89views
Optimal algorithm to move a a rope from one position to another
I'm an engineer working with a deformable membrane that is attached to actuators. The goal is to move the membrane from one shape to another, without ripping the membrane. This imposes "neighbor ...
4votes
0answers
718views
Find the closest parametric values corresponding to a BSpline's control points
On a curve generated by scipy.interpolate.BSpline I want to find the closest parameters relative to each control point, so that the given parametric range is ...
3votes
2answers
120views
Cythonized Sutherland-Hogman algorithm
I want to cythonise the python implementation of the Sutherland-Hogman algorithm. This algorithm updates a list of vertices according to pretty simple rules (being inside or outside an edge, etc.) but ...
7votes
1answer
3kviews
4-Bar Mechanism Generation
For a school project, I will design and prototype a bicycle brake that uses a four-bar linkage to accomplish its goal. My Python 3 code does this mechanism generation, and implements methods to ...
5votes
1answer
5kviews
Applying Laplacian smoothing to vertices in a mesh
I'm totally new in Python and I wrote some code. It is a simple algorithm to smooth objects. I need to find adjacent vertices in mesh and sum their coordinates and after that divide by a number of ...
5votes
1answer
599views
Clustering points on a sphere
I have written a short Python program which does the following: loads a large data file (\$10^9+\$ rows) where each row is a point on a sphere. The code then loads a pre-determined triangular grid on ...
14votes
3answers
15kviews
Generate sample coordinates inside a Polygon
I have a Polygon named as poly. I attempted to randomly select 5 coordinate points that lies inside the polygon. ...
4votes
1answer
266views
Calculating the distance squared between all vertex-pairs of a number of 2D polygons
I have implemented my code using Cython. It is the current bottleneck in my computations. There are two non-numpy functions involved: calculate_2D_dist_squared ...
2votes
1answer
362views
Neighbours from point connections
I am working with a mesh of triangles (in 3D, although I doubt it makes a difference). The mesh is given as list of lists, each list containing the indices of the three vertices of a triangle in said ...